﻿using System;
using System.Windows.Media.Imaging;
using jSLCore.Client.Presentation.Common;

namespace jSLCore.Client.Presentation.BaseControl.DialogMessage
{
    public partial class jMessageBox : DialogControl
    {
        public jMessageBox(string message,jMessageBoxIconType iconType)
        {
            InitializeComponent();
            txt.Text = message;
           
            switch (iconType)
            {
                case jMessageBoxIconType.Error: img.Source = new BitmapImage(SLWPFSelector.CompileResourceString(@"Resources/Error.png"));
                    break;
                case jMessageBoxIconType.Warning: img.Source = new BitmapImage(SLWPFSelector.CompileResourceString(@"Resources/Warning.png"));
                    break;
                case jMessageBoxIconType.Info: img.Source = new BitmapImage(SLWPFSelector.CompileResourceString(@"Resources/Info.png"));
                    break;
                case jMessageBoxIconType.Question: img.Source = new BitmapImage(SLWPFSelector.CompileResourceString(@"Resources/Question.png"));
                    break;
                default:break;
            }
        }

        public override object CancelContent
        {
            get { return "Закрыть"; }
        }

        public override bool AutoSize
        {
            get { return true; }
        }
        
        public override bool IsStandartOkCancelEnabled
        {
            get { return true; }
        }

        public override void OkClicked()
        {
            InvokeDataSelected(null);
        }

        public override bool IsOkVisible
        {
            get { return false; }
        }


    }
}